<?php

namespace Project\ScrumBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Userstories
 *
 * @ORM\Table(name="userstories")
 * @ORM\Entity
 */
class Userstories
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id_userstorie", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $idUserstorie;

    /**
     * @var string
     *
     * @ORM\Column(name="role", type="string", length=45, nullable=true)
     */
    private $role;

    /**
     * @var string
     *
     * @ORM\Column(name="action", type="string", length=45, nullable=true)
     */
    private $action;

    /**
     * @var string
     *
     * @ORM\Column(name="but", type="string", length=45, nullable=true)
     */
    private $but;

    /**
     * @var string
     *
     * @ORM\Column(name="pts_difficulte", type="string", length=45, nullable=true)
     */
    private $ptsDifficulte;

    /**
     * @var string
     *
     * @ORM\Column(name="statut", type="string", length=45, nullable=true)
     */
    private $statut;

    /**
     * @var string
     *
     * @ORM\Column(name="ordre_priorite", type="string", length=45, nullable=true)
     */
    private $ordrePriorite;

    /**
     * @var boolean
     *
     * @ORM\Column(name="affectation", type="boolean", nullable=true)
     */
    private $affectation;

    /**
     * @var \Doctrine\Common\Collections\Collection
     *
     * @ORM\ManyToMany(targetEntity="Cra", inversedBy="userstoriesUserstorie")
     * @ORM\JoinTable(name="userstories_has_cra",
     *   joinColumns={
     *     @ORM\JoinColumn(name="userstories_id_userstorie", referencedColumnName="id_userstorie")
     *   },
     *   inverseJoinColumns={
     *     @ORM\JoinColumn(name="cra_id", referencedColumnName="id")
     *   }
     * )
     */
    private $cra;

    /**
     * @var \Utilisateur
     *
     * @ORM\ManyToOne(targetEntity="Utilisateur")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="ref_client", referencedColumnName="id")
     * })
     */
    private $refClient;

    /**
     * @var \Projet
     *
     * @ORM\ManyToOne(targetEntity="Projet")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="ref_projet", referencedColumnName="id_projet")
     * })
     */
    private $refProjet;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->cra = new \Doctrine\Common\Collections\ArrayCollection();
    }
    

    /**
     * Get idUserstorie
     *
     * @return integer 
     */
    public function getIdUserstorie()
    {
        return $this->idUserstorie;
    }

    /**
     * Set role
     *
     * @param string $role
     * @return Userstories
     */
    public function setRole($role)
    {
        $this->role = $role;
    
        return $this;
    }

    /**
     * Get role
     *
     * @return string 
     */
    public function getRole()
    {
        return $this->role;
    }

    /**
     * Set action
     *
     * @param string $action
     * @return Userstories
     */
    public function setAction($action)
    {
        $this->action = $action;
    
        return $this;
    }

    /**
     * Get action
     *
     * @return string 
     */
    public function getAction()
    {
        return $this->action;
    }

    /**
     * Set but
     *
     * @param string $but
     * @return Userstories
     */
    public function setBut($but)
    {
        $this->but = $but;
    
        return $this;
    }

    /**
     * Get but
     *
     * @return string 
     */
    public function getBut()
    {
        return $this->but;
    }

    /**
     * Set ptsDifficulte
     *
     * @param string $ptsDifficulte
     * @return Userstories
     */
    public function setPtsDifficulte($ptsDifficulte)
    {
        $this->ptsDifficulte = $ptsDifficulte;
    
        return $this;
    }

    /**
     * Get ptsDifficulte
     *
     * @return string 
     */
    public function getPtsDifficulte()
    {
        return $this->ptsDifficulte;
    }

    /**
     * Set statut
     *
     * @param string $statut
     * @return Userstories
     */
    public function setStatut($statut)
    {
        $this->statut = $statut;
    
        return $this;
    }

    /**
     * Get statut
     *
     * @return string 
     */
    public function getStatut()
    {
        return $this->statut;
    }

    /**
     * Set ordrePriorite
     *
     * @param string $ordrePriorite
     * @return Userstories
     */
    public function setOrdrePriorite($ordrePriorite)
    {
        $this->ordrePriorite = $ordrePriorite;
    
        return $this;
    }

    /**
     * Get ordrePriorite
     *
     * @return string 
     */
    public function getOrdrePriorite()
    {
        return $this->ordrePriorite;
    }

    /**
     * Set affectation
     *
     * @param boolean $affectation
     * @return Userstories
     */
    public function setAffectation($affectation)
    {
        $this->affectation = $affectation;
    
        return $this;
    }

    /**
     * Get affectation
     *
     * @return boolean 
     */
    public function getAffectation()
    {
        return $this->affectation;
    }

    /**
     * Add cra
     *
     * @param \Project\ScrumBundle\Entity\Cra $cra
     * @return Userstories
     */
    public function addCra(\Project\ScrumBundle\Entity\Cra $cra)
    {
        $this->cra[] = $cra;
    
        return $this;
    }

    /**
     * Remove cra
     *
     * @param \Project\ScrumBundle\Entity\Cra $cra
     */
    public function removeCra(\Project\ScrumBundle\Entity\Cra $cra)
    {
        $this->cra->removeElement($cra);
    }

    /**
     * Get cra
     *
     * @return \Doctrine\Common\Collections\Collection 
     */
    public function getCra()
    {
        return $this->cra;
    }

    /**
     * Set refClient
     *
     * @param \Project\ScrumBundle\Entity\Utilisateur $refClient
     * @return Userstories
     */
    public function setRefClient(\Project\ScrumBundle\Entity\Utilisateur $refClient = null)
    {
        $this->refClient = $refClient;
    
        return $this;
    }

    /**
     * Get refClient
     *
     * @return \Project\ScrumBundle\Entity\Utilisateur 
     */
    public function getRefClient()
    {
        return $this->refClient;
    }

    /**
     * Set refProjet
     *
     * @param \Project\ScrumBundle\Entity\Projet $refProjet
     * @return Userstories
     */
    public function setRefProjet(\Project\ScrumBundle\Entity\Projet $refProjet = null)
    {
        $this->refProjet = $refProjet;
    
        return $this;
    }

    /**
     * Get refProjet
     *
     * @return \Project\ScrumBundle\Entity\Projet 
     */
    public function getRefProjet()
    {
        return $this->refProjet;
    }
}